@echo off
chcp 936 >nul
echo Starting microservices compilation...
echo.

:: Compile common module
echo Compiling common-module...
cd /d F:\shopping\common-module
mvn clean install -DskipTests
echo common-module compilation completed with code: %ERRORLEVEL%

:: Compile auth service
echo Compiling auth-service...
cd /d F:\shopping\auth-service
mvn clean package -DskipTests
echo auth-service compilation completed with code: %ERRORLEVEL%

:: Compile user service
echo Compiling user-service...
cd /d F:\shopping\user-service
mvn clean package -DskipTests
echo user-service compilation completed with code: %ERRORLEVEL%

:: Compile product service
echo Compiling product-service...
cd /d F:\shopping\product-service
mvn clean package -DskipTests
echo product-service compilation completed with code: %ERRORLEVEL%

:: Compile order service
echo Compiling order-service...
cd /d F:\shopping\order-service
mvn clean package -DskipTests
echo order-service compilation completed with code: %ERRORLEVEL%

:: Compile gateway service
echo Compiling gateway-service...
cd /d F:\shopping\gateway-service
mvn clean package -DskipTests
echo gateway-service compilation completed with code: %ERRORLEVEL%

echo.
echo All compilations completed!
echo.
echo Press any key to exit...
pause